package com.example.leetcode.test;

import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

public class MyLinkHashMap<Integer,String> {

    private Map<Integer,String> map;

    private List<Integer> list ;

    public MyLinkHashMap() {
        this.map = new HashMap<>();
        this.list = new LinkedList<>();
    }


    public void put(Integer key,String value){
        list.add(key);
        map.put(key,value);
    }


    public String get(Integer key){
        return map.get(key);
    }

    public void print(){
        for (Integer key:list) {
            System.out.println(map.get(key));
        }
    }
}
